/**
   HotInterceptor
 * Time:2018年7月12日
 */
package com.ssm.interceptor;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import com.ssm.controller.BaseController;
import com.ssm.service.HotService;
import com.ssm.service.VideoMessageService;

/**
 * @author 15199
 *
 */
public class HotInterceptor extends BaseController implements HandlerInterceptor  {

	@Resource
	private VideoMessageService videoMessageService;
	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {	 	
		String id=request.getParameter("id");
		id=id.trim(); 
		if(id!=null){
			videoMessageService.updateHot(parseInt(id));		
		}	
		return true;
	}

	@Override
	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {	
	}
	@Override
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex)
					throws Exception {	
	}
}
